package Test10;

/**
 * Created by 14229 on 2020/2/21.
 */
public class Car extends Reckon {
    private Integer days;

    @Override
    public String toString() {
        return getChepaihao()+","+getPinpai()+","+getColor()+","+getShijian()+","+getCount()+"辆";
    }

    public Car(String chepaihao, String pinpai, String color, int zujin, long shijian, int count, Integer days) {
        super(chepaihao, pinpai, color, zujin, shijian, count);
        this.days = days;
    }

    @Override
    public int money(Reckon reckon) {
        if("别克商务".equals(getPinpai())){
            setZujin(600);
        }else if("宝马550i".equals(getPinpai())){
            setZujin(500);
        }else if("别克林荫大道".equals(getPinpai())){
            setZujin(300);
        }
        return getZujin()*days;
    }

    public Car() {
    }

    public Integer getDays() {
        return days;
    }

    public void setDays(Integer days) {
        this.days = days;
    }

    public Car(Integer days) {
        this.days = days;
    }

    public Car(String chepaihao, String pinpai, String color, int zujin, long shijian, Integer days) {
        super(chepaihao, pinpai, color, zujin, shijian);
        this.days = days;
    }
}
